package com.sunwayworld.basemodule.samplemanage.samplecodegenerate.resource.impl;

import com.sunwayworld.basemodule.samplemanage.samplecodegenerate.resource.LimsSamplecodeGenerateRecordResource;
import com.sunwayworld.basemodule.samplemanage.samplecodegenerate.service.LimsSamplecodeGenerateRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("样本编码生成记录")
@RestController
@GikamBean
public class LimsSamplecodeGenerateRecordResourceImpl implements LimsSamplecodeGenerateRecordResource {

    @Autowired
    private LimsSamplecodeGenerateRecordService limsSamplecodeGenerateRecordService;

    @Override
    public LimsSamplecodeGenerateRecordService getService() {
        return limsSamplecodeGenerateRecordService;
    }

    @Log(value = "新增样本编码生成记录", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @PostMapping(value = "/print")
    public Long print(RestJsonWrapperBean jsonWrapperBean) {
        return this.getService().print(jsonWrapperBean);
    }

}
